<%@ page contentType="text/html; charset=utf-8" language="java" %>
<%@ include file="/sys/include/header.jsp" %>
<html >
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>CTM评分</title>
<link href="sys/style01/css/table.css" rel="stylesheet" type="text/css">
<link href="sys/css/banzu.css" rel="stylesheet" type="text/css"  >
</head>
<body class="ridgeBody" >
<script language="javascript">	

	function countTotal(obj){
		if(Number(obj.value)>10||Number(obj.value)<0){
			alert("评分项的数值必须在0~10之间，请重新输入");
			obj.value="0";
			obj.focus();		
		}
		var gradea = Number(document.getElementById("gradea").value);
		var gradeb = Number(document.getElementById("gradeb").value);
		var gradec = Number(document.getElementById("gradec").value);
		var graded = Number(document.getElementById("graded").value);
		var gradee = Number(document.getElementById("gradee").value);
		var gradef = Number(document.getElementById("gradef").value);
		var gradeg = Number(document.getElementById("gradeg").value);

		var total = gradea*${beanRule.gradeA}+gradeb*${beanRule.gradeB}+gradec*${beanRule.gradeC}+graded*${beanRule.gradeD}+gradee*${beanRule.gradeE}+gradef*${beanRule.gradeF}+gradeg*${beanRule.gradeG};
		document.getElementById("grade_totall").value = total;		
		document.getElementById("bean.grade_totall_span").innerText=total;
	}
	
	function getNum(){	
		var grade;
		      grade = Number(document.getElementById("gradea").value)+",";
			grade +=Number(document.getElementById("gradeb").value)+",";
			grade +=Number(document.getElementById("gradec").value)+",";
			grade +=Number(document.getElementById("graded").value)+",";
			grade +=Number(document.getElementById("gradee").value)+",";
			grade +=Number(document.getElementById("gradef").value)+",";
			grade +=Number(document.getElementById("gradeg").value)+",";
			grade +=Number(document.getElementById("grade_totall").value);
			return grade;
	}
	
	function add(){
		var grade=getNum();
		var ctm_grade_id = "${bean.ctm_grade_id}";
		window.opener.queryFrom.action="pay/createCtmGradePopDo.action?grade="+grade+"&ctm_grade_id="+ctm_grade_id;
		window.opener.queryFrom.submit();
		window.close();
	}
</script>
<body class="ridgeBody">
	<form name="form1" method="post" action="business/area/areainsert.action">
		<table class=datatable width=80% cellpadding='0' cellspacing='0' border='1' bordercolorDark='white' bordercolorLight='#BEBEBE' >
      		<tr><td height="28" colspan="2" valign="top" class="dataTitle">CTM评分</td></tr>
			<tr>
        		<td height="22" valign="top" nowrap class="datatr1"> CTM姓名：</td>	
				<td valign="top" nowrap >&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;${bean.emp_name}(${bean.emp_code})</td>
 	 		</tr>
      		<tr>
        		<td height="22" valign="top" nowrap class="datatr1"style="text-align: center;"> 评分项A:<br>及时有效管理和监控代理商店面形象，<br>包括店内产品出样和宣传资料有效使用：</td>	
				<td valign="center" nowrap ><input name="gradea" id = "gradea" type="text" class="input" value="${bean.gradea}" onchange="countTotal(this)" /></td>
 	 		</tr>
 	 		<tr>
        		<td height="22" valign="top" nowrap class="datatr1" style="text-align: center;"> 评分项B:<br>及时有效管理和监控公司<br>促销活动在代理商店面的执行：</td>	
				<td valign="center" nowrap ><input name="gradeb" id="gradeb" type="text" class="input" value="${bean.gradeb}" onchange="countTotal(this)"/></td>
 	 		</tr>
 	 		<tr>
        		<td height="22" valign="top" nowrap class="datatr1" style="text-align: center;"> 评分项C:<br>完成对代理商店面销售人员公司文化、<br>产品知识和销售技巧的培训的培训：</td>	
				<td valign="center" nowrap ><input name="gradec" id="gradec" type="text" class="input" value="${bean.gradec}" onchange="countTotal(this)"/></td>
 	 		</tr>
 	 		<tr>
        		<td height="22" valign="top" nowrap class="datatr1" style="text-align: center;"> 评分项D:<br>及时准确管理代理商店面信息资料库：</td>	
				<td valign="center" nowrap ><input name="graded" id="graded" type="text" class="input" value="${bean.graded}" onchange="countTotal(this)"/></td>
 	 		</tr>
 	 		<tr>
        		<td height="22" valign="top" nowrap class="datatr1" style="text-align: center;"> 评分项E:<br>及时检查和反馈店面价格信息：</td>	
				<td valign="center" nowrap ><input name="gradee" id="gradee" type="text" class="input" value="${bean.gradee}" onchange="countTotal(this)"/></td>
 	 		</tr>
 	 		<tr>
        		<td height="22" valign="top" nowrap class="datatr1" style="text-align: center;"> 评分项F:<br>及时准确反馈竞品信息：</td>	
				<td valign="center" nowrap ><input name="gradef" id="gradef" type="text" class="input" value="${bean.gradef}" onchange="countTotal(this)"/></td>
 	 		</tr>
 	 		<tr>
        		<td height="22" valign="top" nowrap class="datatr1" style="text-align: center;"> 评分项G:<br>对RTM工作支持的执行力度和响应度：</td>	
				<td valign="center" nowrap ><input name="gradeg" id="gradeg" type="text" class="input" value="${bean.gradeg}" onchange="countTotal(this)"/></td>
 	 		</tr>
 	 		<tr>
        		<td height="22" valign="top" nowrap class="datatr1"> 评估合计：</td>	
				<td valign="center" nowrap ><span id="bean.grade_totall_span">${bean.grade_totall}</span>&nbsp;
				<input name="grade_totall" id="grade_totall" type="hidden" class="input"  value="${bean.grade_totall}"/></td>
 	 		</tr>
      		<tr >
        		<td height="21" colspan="2" class="dataTitle"> 
        			<input type="button" name="save" 	value="提交" onClick="add()"/>
	      			<input type="reset"  name="close"  	value="关闭" onClick="window.close();"/>
	      		</td>
			</tr>
		</table>
	</form>
 </body>
</html>